import http from "@/config/request";

/** 点赞 */
export const addLike = (data) => {
    return new Promise((resolve, reject) => {
        http.post("/like/addLike", data).then((res) => {
            resolve(res);
        });
    });
};

/** 判断当前用户是否点赞了 */
export const getIsLikeByIdAndType = (data) => {
    return new Promise((resolve, reject) => {
        http.post("/like/getIsLikeByIdAndType", data).then((res) => {
            resolve(res);
        });
    });
};

/** 取消点赞 */
export const cancelLike = (data) => {
    return new Promise((resolve, reject) => {
        http.post("/like/cancelLike", data).then((res) => {
            resolve(res);
        });
    });
};

export const addFootprint = (data) => {
    return new Promise((resolve, reject) => {
        http.post("/cms/app-site/addFootprint", data).then((res) => {
            resolve(res);
        });
    });
};

export const getFootprint = (params) => {
    return new Promise((resolve, reject) => {
        http.get("/cms/app-site/getFootprint", {params}).then((res) => {
            resolve(res);
        });
    });
};
